package my.diplom.dao.service;

import my.diplom.dao.ICategoryDAO;
import my.diplom.entity.Category;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: gb
 * Date: 14.07.2009
 * Time: 17:21:04
 * To change this template use File | Settings | File Templates.
 */
public class CategoryService {

    private ICategoryDAO categoryDAO;

    public ICategoryDAO getCategoryDAO() {
        return categoryDAO;
    }

    public void setCategoryDAO(ICategoryDAO categoryDAO) {
        this.categoryDAO = categoryDAO;
    }

    public void create(Category category) {
        categoryDAO.create(category);
    }

    public void update(Category category) {
        categoryDAO.update(category);
    }

    public Category getById(Long categoryId) {
        return categoryDAO.getById(categoryId);
    }

    public List<Category> getAll() {
        return categoryDAO.getAll();
    }

    public List<Category> getAllActive() {
        return categoryDAO.getAllActive();
    }

    public Category getByName(String categoryName) {
        return categoryDAO.getByName(categoryName);
    }

    public void delete(Category category) {
        categoryDAO.delete(category);
    }

    public Category getById(Long categoryId, boolean initApplications) {
        return categoryDAO.getById(categoryId, initApplications);
    }
}
